//
//  ViewController.m
//  Demo
//
//  Created by 宣佚 on 15/6/7.
//  Copyright (c) 2015年 宣佚. All rights reserved.
//

#import "ViewController.h"
#import "Andon_TUTK.h"

@interface ViewController () <TUTKClientDelegate,TUTKClientVideoDelegate>

@property (nonatomic, strong) Andon_TUTK *tc;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(IBAction)start:(id)sender
{
    _tc = [[Andon_TUTK alloc] init];
    _tc.delegate = self;
    [_tc start:@"3B5FWLUKDRXKWZPX111A" userName:@"admin" passWord:@"admin"];
}

-(IBAction)stop:(id)sender
{
        [_tc stop];
}

-(void)Tutk_StartConnection
{
    NSLog(@"tutk_StartConnection");
}

-(void)Tutk_Connected_Success:(int)avIndex
{
    NSLog(@"tutk_Connected_success");
    [_tc setVdelegate:self];
    [_tc startVideoQueue:avIndex];
}

-(void)Tutk_Connected_Failure:(NSString *)errorMessage
{
    NSLog(@"er:%@",errorMessage);
}

-(void)Tutk_DisConnected_Success
{
    NSLog(@"Tutk_DisConnected_Success");
}

-(void)Tutk_Video_StartConnection
{
    NSLog(@"Tutk_Video_StartConnection");
}

-(void)Tutk_Video_Connected_Success
{
    NSLog(@"Tutk_Video_Connected_Success");
}

-(void)Tutk_Video_Connected_Failure:(NSString *)errorMessage ErrorType:(ENUM_TUTK_AVERROR_TYPE)ErrorType
{
    NSLog(@"Tutk_Video_Connected_Failure");
}

-(void)tutk_onVideoData:(const void *)data andlength:(unsigned int)length andframeindex:(unsigned int)frameIndex
{
    NSLog(@"onVideoData");
}

@end

